<template>
<div  class="HomeSwiper">
<van-search v-model="value" placeholder="请输入搜索关键词" />
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="blue">
    <van-swipe-item v-for="item in bannnerData" :key="item.id">
      <img :src="item.picUrl" alt="">
    </van-swipe-item>
    </van-swipe>
</div>
</template>

<script>
import axios from "axios"
export default{
   data() {
    return {
      value: '',
      bannnerData:[]
    };
  },
  created(){
      this.getBanner();
    },
 methods:{
      getBanner(){
        axios.get("/api/recommend/banner",)
        .then(res => {
          console.log(res.data.data)
          this.bannnerData = res.data.data
        })
        .catch(err => {
          console.error(err); 
        })
      }
      },
      mounted(){} 
}
</script>
<style scoped>
  .my-swipe .van-swipe-item img{
     width:90%;
   border-radius: 20px;
  }
</style>